﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using App.Interface;
using Newtonsoft.Json;

namespace App.Realization
{
    public class Logintmpl : ILogin
    {
        public string GetMyPowerTree_byusername(string username)
        {
            var result = HttpClientHelper.GetResponse(System.Web.Configuration.WebConfigurationManager.AppSettings["schoolapi"] + "/api/Login/GetMyPowerTree?username=" + username);
            return result;
        }

        public bool SignIn(string username, string password)
        {
            var result = HttpClientHelper.GetResponse(System.Web.Configuration.WebConfigurationManager.AppSettings["schoolapi"] + "/api/Login/Signin?username=" + username + "&password=" + System.Web.HttpUtility.UrlEncode(password, System.Text.Encoding.UTF8));
            return bool.Parse(result);
            // return result;
        }
    }
}
